/*
   file : mmdb.h
   University of Jiangsu
   memoryDB      2010.6
 */


#ifndef _MMDB_MMDB_HEAD_H
#define _MMDB_MMDB_HEAD_H

#include"def_head.h"

void Init_sql(sql_sentence *);
void Init_Field(Field *);
void Init_Table(Table *);
void Init_Record(Record *);
void Init_Row(Row *);
void Init_Atom(Atom *);
void Init_Where_node(Where_node *);
void Init_WhereTable(WhereTable *);
void Init_Where(Where *);
void Init_Select(Select *);
void Init_Create_Table(Create_Table *);
void Init_Update(Update *);
void Init_Insect(Insect *);
void Init_Delete(Delete *);
void Init_Drop_Table(Drop_Table *);


void SetIntVal(Field *,int);
void SetDoubVal(Field *,double);
void SetStrVal(Field *,char *,int);

int GetIntVal(Field *);
double GetDoubVal(Field *);
char *GetStrVal(Field *);

void SetDateType(Field *,enum Date_type);
int AddField(Table *,Field *);
Field *GetField(Table *,char *);


int AddField_Record(Field *,Record *);

void error(char *,int);

void Free_Field(Field *);
void Free_Table(Table *);
void Free_Record(Record *);
void Free_WhereTable(WhereTable *);
void Free_Where(Where *);
void Free_Select(Select *);
void Free_Create(Create_Table *);
void Free_Update(Update *);
void Free_Insect(Insect *);
void Free_Delete(Delete *);
void Free_Drop(Drop_Table *);

#endif
